
log using fpa-bitsaid-appendix-d,replace
version 13.1

**Alternative Estimators

use fpa-aid_bits_final,clear

//table 28: ivreg with panel data: re

set more off
sort dyad year

quietly xtivreg lnaid l.lnaid l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta unsc_member ally coldwar colonial_tie ln_distance  ///
(l.bit_ratf = l.lnt_bit) if oecd_i==1&oecd_j==0, re first vce(conventional)

outreg2 using bits_aid3, label word dec(3) e(N_clust) replace addtext() noni nor2 ctitle("Two-Stage Random Effect") sortvar(l.bit_ratf l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.gdpgr_i l.pta unsc_member ally coldwar)

//table a29

///ivreg w re

set more off
sort dyad year

gen inter1=bit_ratf*dpi_yio
gen inter1_ex=lnt_bit*dpi_yio

quietly xtivreg lnaid l.lnaid l.dpi_yio l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta l.unsc_member l.ally l.coldwar colonial_tie ln_distance yr* ///
(l.bit_ratf l.inter1= l.lnt_bit l.inter1_ex) if oecd_i==1&oecd_j==0&p_polity2>=6&p_polity2!=., re first vce(conventional)

outreg2 using bits_aid3, label word dec(3) e(N_clust) replace addtext(Time trend, Y, Dyad FE, N) noni nor2 cttop(Two-Stage Random Effect) ctitle("Democracy") 

quietly xtivreg lnaid l.lnaid l.dpi_yio l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta l.unsc_member l.ally l.coldwar colonial_tie ln_distance yr* ///
(l.bit_ratf l.inter1= l.lnt_bit  l.inter1_ex) if oecd_i==1&oecd_j==0&p_polity2<6&p_polity2!=., re first vce(conventional)

outreg2 using bits_aid3, label word dec(3) e(N_clust) append addtext(Time trend, Y, Dyad FE, N) nor2 ctitle("Non-Democracy") drop(yr yrsq)

/// gmm

xtset dyad year

quietly xtabond2 lnaid L.lnaid L.(bit_ratf p_polity2 ln_gdppc wdi_gdpgr wdi_fdiin wdi_natrr lnpop conflict gdpgr_i pta )unsc_member ally colonial_tie ln_distance coldwar  if oecd_i==1&oecd_j==0, ///
gmm(L.(lnaid ln_gdppc wdi_natrr gdpgr_i), lag(2 1)) iv(l2.lnt_bit, eq(both)) h(2) robust twostep

outreg2 using bits_aid3, label word dec(3) e(N_clust) append addtext() noni nor2 ctitle("GMM") sortvar(l.bit_ratf l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.gdpgr_i l.pta unsc_member ally coldwar)

///random effect
quietly xtreg lnaid l.lnaid l.bit_ratf l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta unsc_member ally coldwar colonial_tie ln_distance ///
if oecd_i==1&oecd_j==0, robust cluster(dyad)

outreg2 using bits_aid3, label word dec(3)e(N_clust) append addtext() noni nor2 ctitle("One Stage Random Effects") sortvar(l.bit_ratf l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta unsc_member ally coldwar)


///exclude us

use fpa-aid_bits_final,clear

set more off
sort dyad year

//table a30

teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&cowcode!=2

outreg2 using bits_aid30, label word dec(3) e(n1 n0) replace addtext() noni nor2 ctitle("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//table a31: democracies 
///short time horizon

quietly teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<4&dpi_yio!=.&p_polity2>=6&p_polity2!=.&cowcode!=2

outreg2 using bits_aid31, label word dec(3) e(n1 n0) replace ctitle(Democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

///long time horizon

quietly teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>=4&dpi_yio!=.&p_polity2>=6&p_polity2!=.&cowcode!=2

outreg2 using bits_aid31, label word dec(3) e(n1 n0) append ctitle(Democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//table a32: non-democracies
//short time horizon
quietly teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<10&dpi_yio!=.&p_polity2<6&p_polity2!=.&cowcode!=2

outreg2 using bits_aid32, label word dec(3) e(n1 n0) append ctitle(Non-democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

///long time horizon

quietly teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>10&dpi_yio!=.&p_polity2<6&p_polity2!=.&cowcode!=2

outreg2 using bits_aid32, label word dec(3) e(n1 n0) append ctitle(Non-democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//2-stage fe excluding US
//table a33
quietly xtivreg2 lnaid l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta l.unsc_member l.ally l.coldwar yr* ///
(lbit_ratf = l.lnt_bit) if cowcode!=2&oecd_i==1&oecd_j==0, fe first savefirst cluster(dyad)
outreg2 using bits_aid, label word dec(3) e(N_clust) drop(yr*)replace ctitle("2nd stage") noni nor2 title("Excluding the US")

est restore _xtivreg2_lbit_ratf
outreg2 using bits_aid, label word dec(3) e(N_clust) append addtext(Time trend, Y, Dyad FE, Y) noni nor2 ctitle("1st stage")drop(yr yrsq)

//table a34
gen inter1=bit_ratf*dpi_yio
gen inter1_ex=lnt_bit*dpi_yio

///democratic hosts
xtivreg2 lnaid l.dpi_yio l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta l.unsc_member l.ally l.coldwar yr* ///
(l.bit_ratf l.inter1 = l.lnt_bit l.dpi_yio l.inter1_ex) if cowcode!=2&oecd_i==1&oecd_j==0&p_polity2>=6&p_polity2!=., fe first cluster(dyad)
outreg2 using bits_aid, label word dec(3) e(N_clust) replace addtext(Time trend, Y, Dyad FE, Y) noni nor2 ctitle("Demoracies") title(Excluding the US)

///non-democratic hosts
xtivreg2 lnaid l.dpi_yio l.p_polity2  l.ln_gdppc l.wdi_gdpgr l.wdi_fdiin l.wdi_natrr l.lnpop l.conflict l.gdpgr_i l.pta l.unsc_member l.ally l.coldwar yr* ///
(l.bit_ratf l.inter1 = l.lnt_bit l.dpi_yio l.inter1_ex) if cowcode!=2&oecd_i==1&oecd_j==0&p_polity2<6&p_polity2!=., fe first cluster(dyad)
outreg2 using bits_aid, label word dec(3) e(N_clust) append addtext(Time trend, Y, Dyad FE, Y) noni nor2 ctitle("Non-Democracies")


***isds clause only
//mkdir C:/results
//cd C:/results

use fpa-aid_bits_final,clear

set more off
sort dyad year

//table a35
teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(bit_isds lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0

outreg2 using bits_aid1, label word dec(3) e(n1 n0) replace addtext() noni nor2 ctitle("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)


//table a36: democracies
use fpa-aid_bits_final,clear
set more off
sort dyad year

//democracies
///short time horizon

teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(bit_isds lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<4&dpi_yio!=.&p_polity2>=6&p_polity2!=.

outreg2 using bits_aid2, label word dec(3) e(n1 n0) replace ctitle(Democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

///long time horizon

teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(bit_isds lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>=4&dpi_yio!=.&p_polity2>=6&p_polity2!=.

outreg2 using bits_aid2, label word dec(3) e(n1 n0) append ctitle(Democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//table a37: non-democracies
///short time horizon
teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(bit_isds lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<10&dpi_yio!=.&p_polity2<6&p_polity2!=.

outreg2 using bits_aid3, label word dec(3) e(n1 n0) replace ctitle(Non-democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

///long time horizon
teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(bit_isds lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>10&dpi_yio!=.&p_polity2<6&p_polity2!=.

outreg2 using bits_aid3, label word dec(3) e(n1 n0) append ctitle(Non-democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

***ideal points

use fpa-aid_bits_final,clear

//table a38

teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0

outreg2 using bits_aid4, label word dec(3) e(n1 n0) replace addtext() noni nor2 ctitle("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)


//table a39: democracies
///short time horizon

teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<4&dpi_yio!=.&p_polity2>=6&p_polity2!=.

outreg2 using bits_aid5, label word dec(3) e(n1 n0) replace ctitle(Democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

///long time horizon

teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>=4&dpi_yio!=.&p_polity2>=6&p_polity2!=.

outreg2 using bits_aid5, label word dec(3) e(n1 n0) append ctitle(Democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//talbe a40: non-democracies
///short time horizon
teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<10&dpi_yio!=.&p_polity2<6&p_polity2!=.

outreg2 using bits_aid6, label word dec(3) e(n1 n0) replace ctitle(Non-democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

///long time horizon

teffects aipw (lnaid lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>10&dpi_yio!=.&p_polity2<6&p_polity2!=.

outreg2 using bits_aid6, label word dec(3) e(n1 n0) append ctitle(Non-democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

***exclude humanitarian assistance

//
use fpa-aid_bits_final,clear

teffects aipw (lnaid_noemergency lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lally lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0

//table 41
outreg2 using bits_aid7, label word dec(3) e(n1 n0) replace addtext() noni nor2 ctitle("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//table 42: democracies

///short time horizon

teffects aipw (lnaid_noemergency lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<4&dpi_yio!=.&p_polity2>=6&p_polity2!=.

outreg2 using bits_aid8, label word dec(3) e(n1 n0) replace ctitle(Democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

///long time horizon

teffects aipw (lnaid_noemergency lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>=4&dpi_yio!=.&p_polity2>=6&p_polity2!=.

outreg2 using bits_aid8, label word dec(3) e(n1 n0) append ctitle(Democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//talbe 43: non-democracies
//short time horizon
teffects aipw (lnaid_noemergency lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio<10&dpi_yio!=.&p_polity2<6&p_polity2!=.

outreg2 using bits_aid9, label word dec(3) e(n1 n0) replace ctitle(Non-democracy short) noni nor2 sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

//teffects overlap

///long time horizon

teffects aipw (lnaid_noemergency lp_polity2  lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lgdpgr_i lpta colonial_tie ln_distance lunsc_member lidis  lcoldwar) ///
(lbit_ratf lag_tbit lp_polity2 lln_gdppc lwdi_gdpgr lwdi_fdiin lwdi_natrr llnpop lconflict lpta lally lunsc_member colonial_tie  lcoldwar) if oecd_i==1&oecd_j==0&dpi_yio>10&dpi_yio!=.&p_polity2<6&p_polity2!=.

outreg2 using bits_aid9, label word dec(3) e(n1 n0) append ctitle(Non-democracy long) noni nor2 cttop("AIPW") sortvar(r1vs0.lbit_ratf r0.lbit_ratf)

log close
***

